package com.sne.airways.route.pojo;

import com.sne.airways.basecore.pojo.BaseProperties;
import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: 卞京帅{bjslogin@gmail.com}
 * Date: 12-11-20
 * Time: 下午9:41
 * 航线
 */
@Entity
@Table(name = "EXP_ROUTE")
@BatchSize(size=5)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class ExpRoute extends BaseProperties {

    @Id
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    @Column(length = 45)
    private String routeId;

    @ManyToOne(cascade = {CascadeType.PERSIST,CascadeType.MERGE},fetch = FetchType.LAZY)
    @JoinColumn(name = "startPort")
    private ExpAirPort startPort;

    @ManyToOne(cascade = {CascadeType.PERSIST,CascadeType.MERGE},fetch = FetchType.LAZY)
    @JoinColumn(name = "endPort")
    private ExpAirPort endPort;

    @Column(length = 400)
    private String desc;

    public String getRouteId() {
        return routeId;
    }

    public void setRouteId(String routeId) {
        this.routeId = routeId;
    }

    public ExpAirPort getStartPort() {
        return startPort;
    }

    public void setStartPort(ExpAirPort startPort) {
        this.startPort = startPort;
    }

    public ExpAirPort getEndPort() {
        return endPort;
    }

    public void setEndPort(ExpAirPort endPort) {
        this.endPort = endPort;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
